home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #14
/
Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO
/
prog_bas
/
decdef.zip
/
DECDEF.FRM
< prev
next >
Wrap
Text File
|
1996-01-04
|
6KB
|
250 lines
VERSION 2.00
Begin Form decdef
BackColor = &H00C0C0C0&
BorderStyle = 3 'Fixed Double
Caption = "Decompiler Defeater from MCS Electronics"
ClientHeight = 2835
ClientLeft = 2340
ClientTop = 2895
ClientWidth = 6840
ClipControls = 0 'False
Height = 3240
Left = 2280
LinkTopic = "Form1"
ScaleHeight = 2835
ScaleWidth = 6840
Top = 2550
Width = 6960
Begin CommandButton Command5
BackColor = &H000000FF&
Caption = "Select"
Height = 375
Left = 5280
TabIndex = 5
Top = 840
Width = 1335
End
Begin CommandButton Command4
Caption = "&End"
Height = 495
Left = 5280
TabIndex = 8
Top = 1560
Width = 1335
End
Begin CommandButton Command3
Caption = "Select"
Height = 375
Left = 5280
TabIndex = 2
Top = 360
Width = 1335
End
Begin TextBox exefile
Height = 285
Left = 1440
TabIndex = 4
Top = 960
Width = 3615
End
Begin TextBox prjfile
Height = 285
Left = 1440
TabIndex = 1
Top = 360
Width = 3615
End
Begin CommonDialog CMDialog1
CancelError = -1 'True
Left = 840
Top = 3840
End
Begin CommandButton Command2
Caption = "Method 2"
Height = 495
Left = 3360
TabIndex = 7
Top = 1560
Width = 1695
End
Begin CommandButton Command1
Caption = "Method 1"
Height = 495
Left = 1440
TabIndex = 6
Top = 1560
Width = 1575
End
Begin Label Label3
BackColor = &H00C0C0C0&
Caption = "Technic 1 overwrites the formnames in the EXE file. Technic 2 overwrites all the controlnames of the forms. "
Height = 615
Left = 120
TabIndex = 9
Top = 2160
Width = 6495
WordWrap = -1 'True
End
Begin Label Label2
BackColor = &H00C0C0C0&
Caption = "EXE file"
Height = 255
Left = 120
TabIndex = 3
Top = 960
Width = 1095
End
Begin Label Label1
BackColor = &H00C0C0C0&
Caption = "Project file"
Height = 255
Left = 120
TabIndex = 0
Top = 360
Width = 1095
End
End
DefInt A-Z
Sub Command1_Click ()
ReDim frm$(100)'array to hold the formnames
file$ = exefile.Text
If prjfile.Text <> "" Then
Open prjfile.Text For Input As #1
Do
Line Input #1, r$
If InStr(r$, ".FRM") Then
ftel = ftel + 1: frm$(ftel) = r$ 'add formname
End If
Loop Until EOF(1)
Close #1
st& = 1
ZOEK$ = Chr(&H3) + Chr(&H20) + Chr(&H81)
ps& = ScanFile&(file$, ZOEK$, st&) 'search it
If ps& > 0 Then
Open exefile.Text For Binary As #1
Seek #1, ps&
a$ = Space$(1000)
Get #1, , a$
Seek #1, ps&
GoSub modify 'modify the code
Put #1, , a$ 'write it back
Close #1
MsgBox "Done!"
Else
MsgBox "Not a compiled VB 3 file!"
End If
End If
Exit Sub
modify:
gv = False
For b = 1 To ftel
z = InStr(a$, frm$(b))
If z > 0 Then
l$ = String$(Len(frm$(b)), 0)
Mid$(a$, z) = l$
End If
Next
Return
End Sub
Sub Command2_Click ()
file$ = exefile.Text
zk1$ = Chr(2) + Chr(4) + Chr(0)
zk2$ = Chr(3) + Chr(4) + Chr(0)
tel = 0
st& = 1
ZOEK$ = Chr(&HFF) + Chr(&HCC) + Chr(&H2C) + Chr(0)
Do
ps& = ScanFile&(file$, ZOEK$, st&)
If ps& > 0 Then
tel = tel + 1
GoSub Getinfo
st& = ps& + 10
End If
Loop Until ps& = 0
MsgBox "Ready!"
Exit Sub
Getinfo:
Open exefile.Text For Binary As #1
If Loc(1) + 16384 < LOF(1) Then
a$ = Space$(16384)
Else
a$ = Space$(LOF(1) - Loc(1))
End If
Seek #1, ps&
Get #1, , a$
Close #1
cp$ = a$
p1 = qInStr2%(1, a$, zk1$)
p2 = qInStr2%(1, a$, zk2$)
p1 = min(p1, p2)
If p1 = 0 Then
MsgBox "Error : 1"
Else
'-------skip nul bytes
bg = p1 + 10
Do
c$ = Mid$(a$, bg, 1)
If Asc(c$) <> 0 Then
Exit Do
Else
bg = bg + 1
End If
Loop Until bg = Len(a$)
a$ = Mid$(a$, bg)
ed = InStr(a$, Chr(0))
t$ = Left(a$, ed)
orig = InStr(cp$, t$)
dum$ = String$(Len(t$), 0)
Mid$(cp$, orig) = dum$'replace nullbytes
'-----------write back --------
Open exefile.Text For Binary As #1
Seek #1, ps&
Put #1, , cp$
Close #1
End If
Return
End Sub
Sub Command3_Click ()
cmdialog1.DialogTitle = "Select a VB project file"
cmdialog1.Filter = "*.MAK|*.MAK"
cmdialog1.Action = 1
If Err <> 32755 Then
prjfile.Text = cmdialog1.Filename
End If
End Sub
Sub Command4_Click ()
End
End Sub
Sub Command5_Click ()
cmdialog1.DialogTitle = "Select the EXE file to protect"
cmdialog1.Filter = "*.EXE|*.EXE"
cmdialog1.Action = 1
If Err <> 32755 Then
exefile.Text = cmdialog1.Filename
End If
End Sub
Function min (y, x)
If y > 0 And x > 0 Then
If y < x Then min = y Else min = x
ElseIf y > 0 Then
min = y
ElseIf x > 0 Then
min = x
Else
min = 0
End If
End Function